﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectSem3
{
    public partial class SiteUser : System.Web.UI.MasterPage
    {
        private DataClassesHealthDataContext dc = new DataClassesHealthDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                EmpRegister emp = (EmpRegister)Session["member"];
                if (emp == null)
                {
                    about.Visible = true;
                    member.Visible = true;
                    feedback.Visible = true;
                    order.Visible = true;
                    welcom.Visible = false;
                }
                else
                {
                    about.Visible = true;
                    member.Visible = false;
                    feedback.Visible = true;
                    order.Visible = true;
                    welcom.Visible = true;
                    this.LabelUsername.Text = emp.username;
                }
            }
        }
        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            Session["member"] = null;
            Response.Redirect("index.aspx");
        }
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            if (this.Search.Value == null)
            {
                return;
            }
            else
            {
                string search = this.Search.Value;
                Response.Redirect("SearchPolicy.aspx?str=" + search);
            }
        }

    }
}